<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    //混合模式
    function CreatePerson(name, qq) {
      //构造函数，构造了对象出来（属性）
      this.name = name;
      this.qq = qq;
    } //原型（在类上加方法，就是css中的class）
    CreatePerson.prototype.showName = function () {
      return "名字是：" + this.name;
    };
    CreatePerson.prototype.showQQ = function () {
      return "qq是：" + this.qq;
    };
    var obj1 = new CreatePerson("小李", "2405878063");
    var obj2 = new CreatePerson("小明", "456465644");
    console.log(obj1.showName === obj2.showName); // true
    console.log(obj2.showQQ()); //qq是：456465644
  </script>
</html>
